﻿using System;

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

using Utils.WeChat;
using Utils.WeChat.Options;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class WeChatExtension
    {
        public static IServiceCollection AddWeChat(this IServiceCollection services)
        {
            services.AddSingleton<IConfigureOptions<WeChatOptions>, WeChatConfigure>();
            return services.AddSingleton<WeChatApp>();
        }

        public static IServiceCollection AddWeChat(this IServiceCollection services, Action<WeChatOptions> options)
        {
            return services.Configure(options).AddWeChat();
        }


    }
}
